const webpack = require('webpack')
const { merge } = require('webpack-merge')
const common = require('./webpack.common')

// Object.assign 完全覆盖掉前一个对象的同名属性
// 使用webpack-merge 追加属性值  用于合并公共配置与该配置
module.exports = merge(common, {
    mode: 'development',
    devtool: 'cheap-eval-module-source-map',
    devServer: {
        contentBase: 'public',
        hot: true,
        open: true,
        port: 8065
    },
    plugins: [
        new webpack.HotModuleReplacementPlugin()
    ]
})